#version 450

// layout(binding = 0)的binding 与 location意义差不多，它被描述符布局引用(估计是用来查找描述符的)
layout(binding = 0) uniform UniformBufferObject {
    mat4 model;
    mat4 view;
    mat4 proj;
} ubo;

//同时绑定多个描述符集时的 layout原语 ： layout(set = 0, binding = 0) uniform UniformBufferObject { ... }  set = ? 对应

//  关于location, 有些类型（例如dvecx）会占用两个索引 layout(location = x+2)
layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inColor;
layout(location = 2) in vec2 inTexCoord;

layout(location = 0) out vec3 fragColor;
layout(location = 1) out vec2 fragTexCoord;

void main() {
    gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 1.0);
    fragColor = inColor;
    fragTexCoord = inTexCoord;
}
